<?php

/**
 +----------------------------------------------+
 * PHP Version 5.2.10                           *
 +----------------------------------------------+
 * 功能说明：处理[qq].*[/qq]的类
 +----------------------------------------------+
 * Author    ：九九                             *
 * QQ        ：405494897                        *
 * Email     ：xjiujiu@foxmail.com              *
 * Copyright ：2010/7/23                        *
 +----------------------------------------------+ 
**/

/**
* @name  qqUBBCode class
* 
*/
class qqUBBCode extends UBBCode{
    public function __construct($content,$value,$UBBCode,$regExp){
        parent::__construct(&$content,$value,$UBBCode,$regExp); 
        $this->htmlCode     = "<a href=\"tencent://message/?Uin={$this->value}&Site=主页&Menu=yes\" target=\"blank\">
            <img src=\"http://wpa.qq.com/pa?p=1:{$this->value}\" alt=\"QQ:{$this->value}\" border=\"0\"/>\\1
        </a>";
    }
    public function replaceUBBCode(){        
        if(($this->content = preg_replace($this->regExp,$this->htmlCode,$this->content,1)) == true){
            return true;
        }else{
            return false;
        }        
    }
}


?>